import service from "../utils/request"
/*
普通用户信息展示
* */
export function getUserInfo(params) {
  return service.request({
    method: "post",
    url: "/user/selfInfo/basicInfo",
    params
  });
}

/*
管理员信息展示
* */
export function getBasicInfo(params) {
  return service.request({
    method: "post",
    url: "/admin/selfInfo/basicInfo",
    params
  });
}

/*
用户修改密码的接口
* */
export function userPasswordEdit(params) {
  return service.request({
    method: "post",
    url: "/user/selfInfo/passwordEdit",
    params
  });
}

/*
管理员改密码的接口
* */
export function adminPasswordEdit(params) {
  return service.request({
    method: "post",
    url: "/admin/selfInfo/passwordEdit",
    params
  });
}

/*
用户修改个人信息
* */
export function editUserBasicInfo(data) {
  return service.request({
    method: "post",
    url: "/user/selfInfo/basicInfo/edit",
    data
  });
}


/*
管理员修改个人信息
* */
export function editAdminBasicInfo(data) {
  return service.request({
    method: "post",
    url: "/admin/selfInfo/basicInfo/edit",
    data
  });
}

/*
普通用户头像上传
* */
export function userCover(params) {
  return service.request({
    method: "post",
    url: "/user/selfInfo/upload/headImg",
    params
  });
}

/*
管理员头像上传
* */
export function adminCover(params) {
  return service.request({
    method: "post",
    url: "/admin/selfInfo/upload/headImg",
    params
  });
}


/*
用户借阅记录
* */
export function userBorrowInfo(params) {
  return service.request({
    method: "get",
    url: "/user/selfInfo/borrowedRecord",
    params
  });
}

/*
用户预定中记录
* */
export function userBookInfo(params) {
  return service.request({
    method: "get",
    url: "/user/selfInfo/reserveBook",
    params
  });
}

/*
用户取消预定
* */
export function userCancelReserve(params) {
  return service.request({
    method: "get",
    url: "/user/reserve/cancel",
    params
  });
}

/*
用户逾期记录
* */
export function userOverdue(params) {
  return service.request({
    method: "get",
    url: "/user/selfInfo/overdueBook",
    params
  });
}

/*
用户逾期归还
* */
export function backOverdueBook(params) {
  return service.request({
    method: "get",
    url: "/user/selfInfo/backOverdueBook",
    params
  });
}
